.ScrollArea {
	--scrollbar-size: 10px;
	width: 200px;
	height: 77%;
	border-radius: var(--radius-3);
	overflow: hidden;
	box-shadow:
		0 0 0 1px var(--gray-a3),
		var(--shadow-4);
}

.Viewport {
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background-color: var(--color-panel-solid);
}

.Scrollbar {
	display: flex;
	user-select: none;
	/* disable browser handling of all panning and zooming gestures on touch devices */
	touch-action: none;
	padding: 2px;
	background-color: var(--gray-a3);
	transition:
		background-color 120ms,
		opacity 60ms;

	&:hover {
		background-color: var(--gray-a4);
	}

	&[data-orientation="vertical"] {
		width: var(--scrollbar-size);
	}
	&[data-orientation="horizontal"] {
		flex-direction: column;
		height: var(--scrollbar-size);
	}
	&[data-state="hidden"] {
		transition-duration: 120ms, 240ms;
		opacity: 0;
	}
}

.Thumb {
	flex: 1;
	background: var(--gray-a9);
	transition: background-color 120ms;
	border-radius: var(--scrollbar-size);
	/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
	position: relative;
	&::before {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		width: 100%;
		height: 100%;
		min-width: 44px;
		min-height: 44px;
	}

	.Scrollbar:hover & {
		background: var(--gray-a11);
	}

	.Corner {
		background: var(--gray-a4);
	}
}
